package com.xxh.dasongapp.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xxh.dasongapp.common.entity.User;
import com.xxh.dasongapp.common.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select u.id,u.username,u.open_id,u.name,u.status,u.create_time,u.update_time,r.role_id from sys_user u join sys_user_role r on u.id=r.user_id ${ew.customSqlSegment}")
    List<UserVo> getUserAndRoleByPage(Page page, @Param(Constants.WRAPPER) Wrapper<UserVo> wrapper);
}
